import { IpcSocketProvider } from "ethers"

// 合约地址配置
export const CONTRACT_ADDRESSES = {
  // Hardhat 本地测试网络
  HARDHAT: {
    TOKEN: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
    AIRDROP: '0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512',
    VOTING: '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0',
    IPFS: '0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9'
  },
  // Sepolia 测试网络
  SEPOLIA: {
    TOKEN: '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0',     // 原 tokenAddress
    AIRDROP: '0x5FbDB2315678afecb367f032d93F642f64180aa3',   // 原 airdropAddress
    VOTING: '0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6'     // 原 votingAddress
  },
  // 主网
  MAINNET: {
    TOKEN: '',
    AIRDROP: '',
    VOTING: ''
  }
}

// 网络配置
export const NETWORKS = {
  HARDHAT: {
    chainId: 31337,
    name: 'Hardhat Local',
    currency: 'ETH',
    rpcUrl: 'http://127.0.0.1:8545',
    blockExplorer: ''
  },
  SEPOLIA: {
    chainId: 11155111,
    name: 'Sepolia',
    currency: 'ETH',
    rpcUrl: import.meta.env.VITE_INFURA_LOCAL || 'http://localhost:8545',
    blockExplorer: 'https://sepolia.etherscan.io'
  },
  MAINNET: {
    chainId: 1,
    name: 'Ethereum Mainnet',
    currency: 'ETH',
    rpcUrl: 'https://mainnet.infura.io/v3/${INFURA_ID}',
    blockExplorer: 'https://etherscan.io'
  }
}
